package com.axjy.util;

import com.github.pagehelper.PageHelper;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
public class PagerAdvice {

    @Before("execution(* com.axjy.service.impl.*.searchPager*(..))")
    public void methodBefore(JoinPoint jp){
       Integer offset=PagerContext.getOffsetTl();
       Integer pageSize=PagerContext.getPageSizeTl();
        PageHelper.offsetPage(offset,pageSize);
    }


}
